#include "mainui.h"
#include "ui_mainui.h"
#include <QDebug>
#include "user.h"

/**
* @projectName   user_login_demo
* @brief         摘要
* @author        Caoshi
* @date          2020-10-07 21:53:05
*/
MainUI::MainUI(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainUI)
{
    ui->setupUi(this);
}

MainUI::~MainUI()
{
    delete ui;
}

void MainUI::setWelcome(QString username)
{
    // qDebug() << "setWelcome()";
    User *u = new User();
    u->setUsername(username);
    // qDebug() << "---------" << u->getUsername();
    ui->welcome->setText("欢迎用户" + u->getUsername() + "登录系统");
     //ui->welcome->setText("欢迎用户" + username + "登录系统");
}

void MainUI::setUserInfo(QString username)
{
    ui->userInfo->setText(username);
}
